home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1010 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.3 KB

  1. Path: zippy.dct.ac.uk!dstn25!ds
  2. Newsgroups: comp.lang.c++
  3. Subject: HELP: Calling functions from DLLs
  4. Message-ID: <1996Jan8.194827.23308@zippy.dct.ac.uk>
  5. From: ds11@st-and.ac.uk (Darren Steers)
  6. Date: 8 Jan 96 19:48:27 GMT
  7. Sender: ds@dstn25 (Darren Steers)
  8. Distribution: world
  9. Organization: University of St Andrews
  10. Nntp-Posting-Host: dstn25.dct.ac.uk
  11.  
  12. Hi,
  13.  
  14. Can you help?  I have been supplied with a DLL (not source code) 
  15. from a third party. It was compiled using MS Visual C++.
  16.  
  17. I am using Borland C++ 4.5 and am having problems calling the functions
  18. from the third party DLL.
  19.  
  20. When I wrote a simple test DLL (Beep.cpp) the function prototype and
  21. declaration were like this (From a book)
  22.  
  23.      void _FAR _EXPFUNC MakeBeep (int iCount);
  24.  
  25. This worked great and I could use the function in my application 
  26. (CallBeep.cpp) to my hearts content.
  27.  
  28. HOWEVER,  the 3rd party DLL had its functions declared in this style
  29.  
  30.      void FAR PASCAL MakeBeep (int iCount);
  31.  
  32. When I try to use this function I get this error message
  33.  
  34.      Linker Error: Undefined symbol MakeBeep(int) in module CALLBEEP.CPP
  35.  
  36. Can I get my application to recognise functions declared in the FAR PASCAL
  37. format, or do I need to get the source code and change the function
  38. prototypes and definitions to _FAR _EXPFUNC ????
  39.  
  40. Thanks for any help.
  41.  
  42. Darren Steers
  43.  
  44. University of St Andrews
  45. Scotland
  46.  
  47. ds11@st-and.ac.uk
  48.